import request from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 登录api接口集合
 * @method signIn 用户登录
 * @method signOut 用户退出登录
 */
export function homeApi() {
	return {

		//查询当天，本周，本月，本年营业额
		selectTurnover: (params?: object) => {
			return request({
				url: '/merchant/WorkSpace/getTurnover',
				method: 'get',
				params,
			});
		},

		//查询营业额统计图
		turnoverStatistics: (params?: object) => {
			return request({
				url: '/merchant/WorkSpace/turnoverStatistics',
				method: 'get',
				params,
			});
		},

       //获取评论和打分
		selectComment: (params?: object) => {
			return request({
				url: '/merchant/comment/getComment',
				method: 'get',
				params,
			});
		},
        //商家删除自己的评论
		deleteComment: (params?: object) => {
			return request({
				url: '/merchant/comment/deleteComment',
				method: 'delete',
				params:params,
			});
		},
		//回复评论                                   
		sureComment: (data: object) => {
			return request({
				url: '/merchant/comment/sureComment',
				method: 'post',
				data,
			});
		},
		// // 更新订单
		// complete: (orderId: string | number) => {
        //     return request({
        //         url: `/merchant/order/complete/${orderId}`,  // 使用模板字符串拼接 URL
        //         method: 'put',
        //          // PUT 请求的数据
        //     });
        // },

		// signIn: (data: object) => {
		// 	return request({
		// 		url: '/merchant/merchant/test',
		// 		method: 'post',
		// 		data,
		// 	});
		// },
		// signOut: (data: object) => {
		// 	return request({
		// 		url: '/user/signOut',
		// 		method: 'post',
		// 		data,
		// 	});
		// },
	};
}
